package com.shop.controller;


import com.shop.annotation.RequireRoles;
import com.shop.entity.MerchantRole;
import com.shop.model.PageParam;
import com.shop.model.vo.Rsp;
import com.shop.service.MerchantRoleService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * yyt(MerchantRole)表控制层
 *
 * @author yyt
 * @since 2020-11-26 11:03:51
 */
@Validated
@RestController
@AllArgsConstructor
@RequestMapping("role")
public class MerchantRoleController {
    /**
     * 服务对象
     */
    private final MerchantRoleService merchantRoleService;

    @RequireRoles(roles = {"merchant"})
    @PostMapping("/getRoleList")
    public Rsp getRoleList(@RequestBody PageParam<MerchantRole> pageParam){
        return merchantRoleService.getRoleList(pageParam);
    }

}